package pl.agh.pp.zephyr.algorithms;

import java.util.LinkedList;
import java.util.List;

import pl.agh.pp.zephyr.algorithms.Command.ArgKey;
import pl.agh.pp.zephyr.algorithms.Command.TYPE;
import pl.agh.pp.zephyr.model.H323Area;

/**
 * Przykładowa implementacja - prosty routing do hosta.
 * 
 * @author peter
 * */
public class SimpleRoutingAlgorithm implements RoutingAlgorithm {

	@Override
	public List<Command> calculateRoute(RouteRequest request, H323Area area) {
		Command c = new Command(TYPE.ROUTE_SIMPLE);
		c.params.put(ArgKey.ROUTE_SIMPLE_ALIAS, request.getCalled().getAlias());
		c.params.put(ArgKey.ROUTE_SIMPLE_CALLING_ENDPOINT_ID, request.getCallingEndpointId());
		c.params.put(ArgKey.ROUTE_SIMPLE_CALL_REF, request.getCallRef());
		List<Command> result = new LinkedList<Command>();
		result.add(c);
		return result;
	}

}
